package com.fund;

import com.fund.domains.Test;
import com.fund.service.TestService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.hibernate.validator.constraints.Length;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

@RestController
@CrossOrigin
@RequestMapping(value = "/test", produces = "application/json;charset=utf-8")
@Api(value = "test", tags = {"测试"})
public class TestController {

    @Autowired
    private TestService testService;

    @RequestMapping(value = "/avgIntstToDay", method ={RequestMethod.POST})
    @ResponseBody
    @ApiOperation("测试方法")
    public String avgIntstToDay(@RequestBody String name)
    {
        Test test = testService.findDateById(1);
        return test.getName();
    }
}
